using System.Data;
using ET;
namespace DA
{
	public class Quotes_Product_DAL
	{
	private clsConnect cls = new clsConnect();

	#region Getdata
	public DataTable BindGirdtb_Quotes_Product(int id)
	{
        return cls.GetData_ID_Int("sp_tb_Quotes_Product_Search", "@Quotes_ID", id);
	}
    public DataTable SumQuotes(int id)
    {
        return cls.GetData_ID_Int("sp_tb_Quotes_Product_Sum", "@Quotes_ID", id);
    }
	#endregion

	#region Insert
	public bool Inserttb_Quotes_Product(Quotes_Product_ET data)
	{
	cls.CreateNewSqlCommand();
	cls.AddParameter("@Materials_ID", data.Materials_ID);
	cls.AddParameter("@Quotes_Product_Quantity", data.Quotes_Product_Quantity);
	cls.AddParameter("@Quotes_Product_Price", data.Quotes_Product_Price);
	cls.AddParameter("@Quotes_Product_VAT", data.Quotes_Product_VAT);
	cls.AddParameter("@Quotes_Product_VAT_Percent", data.Quotes_Product_VAT_Percent);
	cls.AddParameter("@Quotes_Product_TotalCash", data.Quotes_Product_TotalCash);
	cls.AddParameter("@Quotes_ID", data.Quotes_ID);
	cls.ExecuteNonQuery("sp_tb_Quotes_Product_Insert");
	return true;
	}
	#endregion

	#region Update
	public bool Updatetb_Quotes_Product(Quotes_Product_ET data)
	{
	cls.CreateNewSqlCommand();
	cls.AddParameter("@Quotes_Materials_ID", data.Quotes_Materials_ID);
	cls.AddParameter("@Materials_ID", data.Materials_ID);
	cls.AddParameter("@Quotes_Product_Quantity", data.Quotes_Product_Quantity);
	cls.AddParameter("@Quotes_Product_Price", data.Quotes_Product_Price);
	cls.AddParameter("@Quotes_Product_VAT", data.Quotes_Product_VAT);
	cls.AddParameter("@Quotes_Product_VAT_Percent", data.Quotes_Product_VAT_Percent);
	cls.AddParameter("@Quotes_Product_TotalCash", data.Quotes_Product_TotalCash);
	cls.AddParameter("@Quotes_ID", data.Quotes_ID);
	cls.ExecuteNonQuery("sp_tb_Quotes_Product_Update");
	return true;
	}
	#endregion

	#region Delete
	public bool Deletetb_Quotes_Product(int id)
	{
        cls.Delete("sp_tb_Quotes_Product_Delete", "@Quotes_Materials_ID" , id);
	return true;
	}
    public bool Deletetb_Quotes_Product_Default(int id)
    {
        cls.Delete("sp_tb_Quotes_Product_Delete_Default", "@Quotes_ID", id);
        return true;
    }
	#endregion
	}
}